﻿namespace Framework.Resource
{
    /// <summary>
    /// 资源帮助接口
    /// </summary>
    public interface IAssetHelper
    {
        /// <summary>
        /// 加载资源包
        /// </summary>
        /// <param name="packageName">资源包名称</param>
        object LoadPackage(string packageName);
        /// <summary>
        /// 从资源包中加载资源
        /// </summary>
        /// <param name="package">资源包</param>
        /// <param name="assetName">资源名称</param>
        object LoadAssetFromPackage(object package, string assetName);
        /// <summary>
        /// 释放资源包
        /// </summary>
        /// <param name="package"></param>
        void ReleaseAssetPackage(object package);
        /// <summary>
        /// 加载资源依赖项
        /// </summary>
        /// <param name="packageName">资源包名称</param>
        string[] LoadDepends(string packageName);
        /// <summary>
        /// 实例化游戏对象
        /// </summary>
        /// <param name="obj">要实例化的对象</param>
        /// <returns>实例化的游戏对象</returns>
        object InstantiateGameObject(object obj);
        /// <summary>
        /// 销毁游戏对象
        /// </summary>
        /// <param name="obj">要销毁的游戏对象</param>
        void DestroyGameObject(object obj);
        T LoadAssetFromPackage<T>(object package, string assetName);
        /// <summary>
        /// 销毁接口
        /// </summary>
        void Destroy();
    }
}
